/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fixture;


import com.google.inject.Guice;
import com.google.inject.Injector;
import exception.InvalidHostNameException;
import exception.MachineInfoNotCompleteException;
import java.util.logging.Level;
import java.util.logging.Logger;
import model.Machine;
import model.MachineManager;
import model.RealMachine;
import model.VMMachine;
import module.MyModule;
import static org.mockito.Mockito.*;
/**
 *
 * @author pyin
 */
public class FakedMachine {
    static Injector injector = Guice.createInjector(new MyModule());
    static MachineManager mm = injector.getInstance(MachineManager.class);

    public static VMMachine getOfficeVM(){
        try {
            VMMachine vm = (VMMachine) mm.getMachine("win03uepinstall");
            return vm;
        } catch (InvalidHostNameException ex) {
            System.out.println("oops");
        } catch (MachineInfoNotCompleteException ex) {
            ex.printStackTrace();
        }
        return null;
    }

    public static RealMachine getTPX200(){
        try {
            RealMachine rm = (RealMachine) mm.getMachine("think-PC");
            return rm;
        } catch (InvalidHostNameException ex) {
            Logger.getLogger(FakedMachine.class.getName()).log(Level.SEVERE, null, ex);
        } catch (MachineInfoNotCompleteException ex) {
            Logger.getLogger(FakedMachine.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }

}
